package com.lm.upms.api.feign.fallback;

import com.lm.common.core.util.R;
import com.lm.upms.api.dto.UserInfo;
import com.lm.upms.api.feign.RemoteUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * RemoteUserServiceFallbackImpl
 *
 * @author lm
 * @date
 */
@Component
public class RemoteUserServiceFallbackImpl implements RemoteUserService {

    private final static Logger logger = LoggerFactory.getLogger(RemoteUserServiceFallbackImpl.class);

    private Throwable cause;

    public void setCause(Throwable cause) {
        this.cause = cause;
    }

    @Override
    public R<UserInfo> findByUsername(String username) {
        logger.error("feign 查询用户信息失败:{}", username, cause);
        return null;
    }

}